package com.example.xianzhi.controller.API;

import cn.hutool.json.JSONUtil;
import org.lanqiao.mvc.entity.YockMvcAnnotation;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Map;

@YockMvcAnnotation.Controller("/apl_Ad")
public class Apl_AdController {

    @YockMvcAnnotation.RequestMapping("/getAllType.do")
    @YockMvcAnnotation.ResponseBody
    public String getAllType(
            HttpServletRequest request,
            HttpServletResponse response

    ) {
        Map<String, Object> map = new HashMap<>();
        response.setContentType("application/json;charset=utf-8");  //告诉前端返回来的是一个json对象
        map.put("code",200);
        map.put("data","typeInfos");
        String jsonStr = JSONUtil.toJsonStr(map);
        return jsonStr;
    }
}
